# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=go-licenses
pkgver=1.6.0
pkgrel=1
pkgdesc="Reports on the licenses used by a Go package and its dependencies"
url="https://github.com/google/go-licenses"
arch=('loong64' 'x86_64')
license=('Apache')
makedepends=('go')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/google/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz)
sha256sums=('70c1ceb7c342ceb79b63a76caafb13ea3796a51715c742a482eb9d85277311e7')
b2sums=('a37d2e12d0400c18d74ff05d9dfef3354774b374045274457d1be7aff53901f1524fcce973eba53e3be827d868addd54411fcefb32fa14d30daa9d6f7a833036')

build() {
  cd ${pkgname}-${pkgver}
  go build \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
    .
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm755 ${pkgname} "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim: ts=2 sw=2 et:
